package Dao;


import Model.Elder;
import Model.ElderInfo;
import Model.ElderInfoChanged;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

public interface ElderInfoDao {
    int  RecordDel(ElderInfo elderInfo);

    /**
     * 接口
     * @return
     */
    List<ElderInfo> getAllElderList();
    /**
     * 接口
     * @return
     */
    List<ElderInfoChanged> getAllElderChangedList();

    /**
     * 查询
     * @param elderName
     * @param servOrg
     * @param ybID
     * @param personLevel
     * @param personCatagory
     * @param assessType
     * @param serSituation
     */
    List<ElderInfo> findElderInfo(@Param(value="elderName")String elderName,@Param(value="servOrg")String servOrg,
                                  @Param(value="ybID")String ybID,@Param(value="personLevel")String personLevel,
                                  @Param(value="personCatagory")String personCatagory,@Param(value="assessType")String assessType,
                                  @Param(value="serSituation")String serSituation);

    /**
     * 查询/根据id
     * @param id
     */
    ElderInfo findElderInfobyID(@Param("id") Integer id);

    /**
     * 搜索-变更页面
     * @param nameSearch
     * @param ybidSearch
     * @param titleSearch
     * @return
     */
    List<ElderInfoChanged> findElderChangedInfo(@Param("nameSearch")String nameSearch,
                                                @Param("ybidSearch")String ybidSearch,
                                                @Param("titleSearch")String titleSearch);

    void InsertHistoryChange(Map<String,Object> insertInfo);

    int deleteByPrimaryKey(Integer id);
    int updatebyID(ElderInfo elderInfo);

    int createElderInfo(ElderInfo elderInfo);
    ElderInfo getElderStatus(String ybid);
    int updateElderStatus(ElderInfo elderInfo);

    List<ElderInfo> getList(ElderInfo elderInfo);
    List<ElderInfo> getList2(ElderInfo elderInfo);
    void InputExcel(Map<String,Map<String,Object>> param);



    /**
     * 搜索-派工信息页面
     * @param elderName
     * @param Ybid
     * @param ID
     * @return
     */
    List<ElderInfo> searchArrangeElder(@Param(value = "elderName") String elderName , @Param(value="Ybid")String Ybid,
                                       @Param(value="ID")String ID);

    /**
     * 新增派工订单页面：搜索
     * @param elderYbid
     * @return
     */
    List<ElderInfo> findElderInfobyYbid(@Param(value="elderYbid")String elderYbid);

    /**
     * 获取老人的ID和name字段
     */
    List<ElderInfo> getLrIdName();

    /**
     * 根据机构查找姓名
     * @param settlement_code
     * @return
     */
    List<ElderInfo> getLrNameByCode(String settlement_code);

    /**
     * 根据姓名查找身份证
     * @param name
     * @return
     */
    List<ElderInfo> getLrIdNumberByName(String name);

    int updateLrDevice(ElderInfo elderInfo);

    /**
     * 健康信息页面：根据老人医保Id查找姓名
     * @param elderYbid
     * @return
     */
    String findElderNamebyYbid(@Param(value="elderYbid")String elderYbid);

    /**
     * 老人页面添加权限:显示机构名下老人
     * @param settleCode
     * @return
     */
    List<ElderInfo> getElderbySettleCode(@Param(value="settleCode")String settleCode);

    /**
     * 老人变更页面添加权限:显示机构名下老人
     * @param settleCode
     * @return
     */
    List<ElderInfoChanged> getAllElderChangedsbySettleCode(@Param(value="settleCode")String settleCode);

    /**
     * 老人信息页面添加权限:搜索机构名下老人
     * @param elderName
     * @param servOrg
     * @param ybID
     * @param personLevel
     * @param personCatagory
     * @param assessType
     * @param serSituation
     * @param settleCode
     * @return
     */
    List<ElderInfo> findElderInfobySettleCode(@Param(value="elderName")String elderName,
                                              @Param(value="servOrg")String servOrg,
                                              @Param(value="ybID")String ybID,
                                              @Param(value="personLevel")String personLevel,
                                              @Param(value="personCatagory")String personCatagory,
                                              @Param(value="assessType")String assessType,
                                              @Param(value="serSituation")String serSituation,
                                              @Param(value="settleCode")String settleCode);
    /**
     * 搜索/变更页面
     * @param nameSearch
     * @param ybidSearch
     * @param titleSearch
     * @param settleCode
     * @return
     */
    List<ElderInfoChanged> findElderInfoChangedsbySettleCode(@Param(value="nameSearch")String nameSearch,
                                                            @Param(value="ybidSearch")String ybidSearch,
                                                            @Param(value="titleSearch")String titleSearch,
                                                            @Param(value="settleCode")String settleCode);

    /**
     * 新增订单页面：搜索机构名下的老人
     * @param elderName
     * @param Ybid
     * @param ID
     * @param SettleCode
     * @return
     */
    List<ElderInfo> searchArrangeElderbySettleCode(@Param(value="elderName")String elderName,
                                                   @Param(value="Ybid")String Ybid,
                                                   @Param(value="ID")String ID,
                                                   @Param(value="SettleCode")String SettleCode);

    /**
     * 根据老人的信标Id查找姓名和医保Id
     * @param device_lr 信标
     * @return
     */
    List<ElderInfo> findNameByDeviceLr(String device_lr);
}
